<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	<article class="container container-c51-create-order clearfix">
		<div th:replace="common/left::c_side"></div>
		<section class="content">
			<div class="m-crumb">
				<p>
					<a href="#">订单管理 > </a> <span>新建订单</span>
				</p>
			</div>
			<div class="m-table-sell">
				<div class="m-table-cont">
					<input id="purchaseOrderId" type="hidden" th:value="${purchaseOrderId}" />
					<input id="currency" type="hidden" th:value="${currency}" />
					<input id="price" type="hidden" th:value="${price}"/>
					<table width="100%" summay="" cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th>序号</th>
								<th>描述</th>
								<th>计划金额</th>
								<th>实际金额</th>
								<th>操作</th>
								<th>合计及校对金额</th>
							</tr>
						</thead>
						<tbody class="purchaseOrderPaymentClass">
							<tr class="edit-tr-wrap" style="border-left-width: 4px; border-left-style: solid; border-left-color: rgb(255, 155, 66);">
								<td th:text="001"  id="displayNo_1"></td>
								<td th:text="已付头款" id="orderPaymentRemark_1"></td>
								<td th:text="${currency}+'0'" id="planAmount_1"></td>
								<td th:text="${currency}+'0'" id="billAmount_1"></td>
								<td>
									<a th:onclick="'javascript:openEditPurchaseOrderPayment(this, null, 1);'" style="display: none;"><i class="icon icon-tr-open"></i> 展开编辑</a> 
								    <a th:onclick="'javascript:closeEditPurchaseOrderPayment(this);'"  data-trid="tr003"><i class="icon icon-tr-close"></i> 收起编辑</a>
								    <a th:onclick="'javascript:deletePurchaseOrderPayment(this);'">删除此行</a>
								</td>
								<td class="vaT txL" rowspan="5" style="border-bottom: none;width:100px;">
									<p>
										<strong class="orange" th:text="${currency}+${price}+'0'"></strong>
									</p>
									<p>
										校对金额：<br /><span th:text="${currency}+'0.00'" id="totalPlanAmount"></span>
									</p>
								</td>
							</tr>
							<tr id="purOrderPaymentTemplateTr" class="edit-tr">
		                        <td colspan="5">
		                        <form id="editPurchaseOrderPayment">
		                        	<input type="hidden" name="id"/>
		                        	<input type="hidden" name="displayOrderNo" th:value="1" />
		                            <input type="hidden" name="purchaseOrderId" th:value="${purchaseOrderId}" />
		                            <table width="100%" summay="" cellpadding="0" cellspacing="0">
		                                <tr>
		                                    <td>
		                                        <p>
		                                            <span>付款百分比：</span>
		                                            <span class="m-percent-bar">
		                                                <span class="m-percent-bar-status" style="width:0%"></span>
		                                            </span>
		                                            <span>0%</span>
		                                        </p>
		                                    </td>
		                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;描述：
		                                    	<input class="input" type="text" placeholder="请输入" name="orderPaymentRemark" th:value="已付头款" readonly="readonly"/>
		                                    </td>
		                                    <td></td>
		                                </tr>
		                                <tr>
		                                    <td>
		                                        <p class="p-calendar">
		                                            <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;计划时间：</span>
		                                            <input class="input input-datepicker" type="text" placeholder="请选择时间" name="planTime" /><i class="icon icon-calendar"></i>
		                                        </p>
		                                    </td>
		                                    <td>
		                                        <p class="p-calendar">
		                                            <span>实际时间：</span>
		                                            <input class="input input-datepicker" type="text" placeholder="请选择时间" name="realTime"/><i class="icon icon-calendar"></i>
		                                        </p>
		                                    </td>
		                                    <td>计划金额：<span th:text="${currency}"></span><input class="input" type="text" placeholder="请输入" name="planAmount" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/></td>
		                                </tr>
		                                <tr>
		                                    <td>实际开票金额：<span th:text="${currency}"></span><input class="input" style="width:134px;" type="text" placeholder="请输入" name="billedAmount" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/></td>
		                                    <td>其中，增值税：<span th:text="${currency}"></span><input class="input" style="width:115px;" type="text" placeholder="请输入" name="increamentTax" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/></td>
		                                    <td>不含税金额：<span th:text="${currency}"></span><input class="input" style="width:133px;" type="text" placeholder="请输入" name="amountWithoutTax" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/></td>
		                                </tr>
		                                <tr>
		                                    <td>
		                                        <p class="p-indent"><a href="#">上传验收报告</a></p>
		                                        <p class="p-indent">文件名A.pdf <a href="#">- 删除文件</a></p>
		                                        <p class="p-indent"><a href="#">+增加验收报告</a></p>
		                                    </td>
		                                    <td>
		                                        <p>&nbsp;</p>
		                                        <p class="p-indent"><a href="#">上传发票</a></p>
		                                        <p class="p-indent">文件名A.pdf <a href="#">- 删除文件</a></p>
		                                        <p class="p-indent"><a href="#">+增加发票</a></p>
		                                    </td>
		                                    <td></td>
		                                </tr>
		                                <tr>
		                                    <td colspan="3">
		                                        <p>
		                                            <span class="vaT">填写备注：</span>
		                                            <textarea name="remark" cols="80" rows="5"></textarea>
		                                        </p>
		                                    </td>
		                                </tr>
		                                <tr>
		                                    <td colspan="3">
		                                    	<p class="btn-bar">
			                                        <a onclick="javascript:modifyPurchaseOrderPayment();" class="btn btn-cyan btn-small">确定修改</a>
													<a onclick="javascript:closeEditPurchaseOrderPayment();" class="btn btn-simple btn-small">取消</a>
												</p>
		                                    </td>
		                                </tr>
		                            </table>
		                            </form>
		                        </td>
		                    </tr>
							<tr>
								<td th:text="002" id="displayNo_2"></td>
								<td th:text="一阶段" id="orderPaymentRemark_2"></td>
								<td th:text="${currency}+'0'" id="planAmount_2"></td>
								<td th:text="${currency}+'0'" id="paidAmount_2"></td>
								<td>
									<a th:onclick="'javascript:openEditPurchaseOrderPayment(this, null, 2);'"><i class="icon icon-tr-open"></i> 展开编辑</a> 
								    <a th:onclick="'javascript:closeEditPurchaseOrderPayment(this);'" style="display: none;" data-trid="tr003"><i class="icon icon-tr-close"></i> 收起编辑</a>
								    <a th:onclick="'javascript:deletePurchaseOrderPayment(this);'">删除此行</a>
								</td>
							</tr>
							<tr>
								<td th:text="003" id="displayNo_3"></td>
								<td th:text="二阶段" id="orderPaymentRemark_3"></td>
								<td th:text="${currency}+'0'" id="planAmount_3"></td>
								<td th:text="${currency}+'0'" id="paidAmount_3"></td>
								<td>
									<a th:onclick="'javascript:openEditPurchaseOrderPayment(this, null, 3);'"><i class="icon icon-tr-open"></i> 展开编辑</a> 
								    <a th:onclick="'javascript:closeEditPurchaseOrderPayment(this);'" style="display: none;" data-trid="tr003"><i class="icon icon-tr-close"></i> 收起编辑</a>
								    <a th:onclick="'javascript:deletePurchaseOrderPayment(this);'">删除此行</a>
								</td>
							</tr>
							<tr>
								<td th:text="004" id="displayNo_4"></td>
								<td th:text="三阶段" id="orderPaymentRemark_4"></td>
								<td th:text="${currency}+'0'" id="planAmount_4"></td>
								<td th:text="${currency}+'0'" id="paidAmount_4"></td>
								<td>
									<a th:onclick="'javascript:openEditPurchaseOrderPayment(this, null, 4);'"><i class="icon icon-tr-open"></i> 展开编辑</a> 
								    <a th:onclick="'javascript:closeEditPurchaseOrderPayment(this);'" style="display: none;" data-trid="tr003"><i class="icon icon-tr-close"></i> 收起编辑</a>
								    <a th:onclick="'javascript:deletePurchaseOrderPayment(this);'">删除此行</a>
								</td>
							</tr>
							<tr>
								<td th:text="005" id="displayNo_5"></td>
								<td th:text="四阶段" id="orderPaymentRemark_5"></td>
								<td th:text="${currency}+'0'" id="planAmount_5"></td>
								<td th:text="${currency}+'0'" id="paidAmount_5"></td>
								<td>
									<a th:onclick="'javascript:openEditPurchaseOrderPayment(this, null, 5);'"><i class="icon icon-tr-open"></i> 展开编辑</a> 
								    <a th:onclick="'javascript:closeEditPurchaseOrderPayment(this);'" style="display: none;" data-trid="tr003"><i class="icon icon-tr-close"></i> 收起编辑</a>
								    <a th:onclick="'javascript:deletePurchaseOrderPayment(this);'">删除此行</a>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
			<div class="m-table-sell m-table-sell-inputs">
				<div class="m-table-cont">
				<form id="purchaseOrderItemForm">
					<table width="100%" summay="" cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th colspan="2">序号</th>
								<th>商品</th>
								<th>计划数量</th>
								<th>已发出数量</th>
								<th>已确认数量</th>
								<th>单位</th>
								<th>要求到货时间</th>
								<th>实际到货时间</th>
							</tr>
						</thead>
						<tbody class="purchaseOrderItemClass">
							<tr>
								<input type="hidden" th:value="${purchaseOrderId}" name="purchaseOrderId"/>
								<input type="hidden" th:value="1" name="orderItemNo"/>
								<td><input type="checkbox" /></td>
								<td th:text="1" id="orderItemNo_1"></td>
								<td>
									<select id="materialId_1" class="select select-w140" placeholder="商品名称" name="materialId">
										<option th:each="material : ${materialList}" th:value="${material.id}" th:text="${material.materialName}">Unit</option>
									</select>
									<a class="btn btn-cyan btn-small" style="height:20px;" onclick="javascript: addClientMaterial(this, 1);">新增</a>
								</td>
								<td>
									<input id="quantity_1" class="w80 input" type="text" placeholder="计划数量" name="quantity" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/>
								</td>
								<td>
									<input id="quantityDelivered_1" class="w80 input" type="text" placeholder="已发出数量" name="quantityDelivered" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/>
								</td>
								<td>
									<input id="quantityConfirmed_1" class="w80 input" type="text" placeholder="已确认数量" name="quantityConfirmed" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/>
								</td>
								<td>
									<select id="unitId_1" class="select select-w140" name="unitId" >
										<option th:each="unit : ${unitList}" th:value="${unit.id}" th:text="${unit.unitName}">Unit</option>
									</select>
								</td>
								<td>
									<p class="p-calendar">
										<input id="planedTime_1" class="w80 input input-datepicker" type="text" name="planedTime"/>
										<i class="icon icon-calendar"></i>
									</p>
								</td>
								<td>
									<p class="p-calendar">
										<input id="actualTime_1" class="w80 input input-datepicker" type="text" name="actualTime"/>
										<i class="icon icon-calendar"></i>
									</p>
								</td>
							</tr>
						</tbody>
					</table>
					</form>
				</div>
			</div>
			<div class="btn-bar">
				<a class="btn btn-cyan btn-small" onclick="javascript: addPurchaseOrderItem();">+ 增加</a>
				<a class="btn btn-orange btn-small" onclick="javascript: delPurchaseOrderItem();">- 删除</a>
			</div>
			<div class="btn-bar txC">
				<a class="btn btn-cyan btn-large" onclick="javascript:submitPurchaseOrderItems();">确定修改并返回</a>
			</div>
		</section>
	</article>
<div th:replace="client/jq-template/template::purchaseOrderPayment"></div>
<div th:replace="client/jq-template/template::purchaseOrderPaymentItem"></div>
<div th:replace="client/jq-template/template::purchaseOrderItem"></div>
</body>
<script data-main="../js/page/b1_supplier" src="../lib/requirejs/require.js"></script>
<script type="text/javascript" src="../lib/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../lib/jquery-tmpl/jquery.tmpl.js"></script>
<script type="text/javascript" src="../js/customer/customer.js"></script>
</html>